package com.group3.hospital.controller;/*
 *@author 时崎
 * 2021/12/31
 */

import com.group3.hospital.bean.Ppt;
import com.group3.hospital.service.PptService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Controller
public class PptController {
    @Resource
    private PptService pptService;
    @RequestMapping("/pptUi")
    public String pptUi(Model model){
        List<Ppt> ppts = new ArrayList<>();
        try {
             ppts = pptService.queryPpts();
             model.addAttribute("ppts",ppts);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "firstpage";
    }
}
